package org.example.order.VO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.models.security.SecurityScheme;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Pattern;

import java.util.Date;

@Data
public class UserVO {
    private Long id;

    @Size(max = 64, message = "用户名长度不能超过64个字符")
    private String username;

    @Size(max = 64, message = "昵称长度不能超过64个字符")
    private String nickname;

    @Size(max = 60, message = "密码长度不能超过60个字符")
    private String password;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Size(max = 20, message = "手机号长度不能超过20个字符")
    private String phone;

    @Size(max = 255, message = "头像URL长度不能超过255个字符")
    private String avatar;

    @Min(value = 0, message = "性别值不正确")
    @Max(value = 2, message = "性别值不正确")
    private Integer gender;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    @Min(value = 0, message = "状态值不正确")
    @Max(value = 1, message = "状态值不正确")
    private Integer status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastLoginTime;

    @Size(max = 64, message = "最后登录IP长度不能超过64个字符")
    private String lastLoginIp;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Min(value = 0, message = "是否删除值不正确")
    @Max(value = 1, message = "是否删除值不正确")
    private Integer isDeleted;

    @Size(max = 32, message = "令牌长度不能超过32个字符")
    private String token;

    @Size(max = 500, message = "描述长度不能超过500个字符")
    private String description;
}